﻿@model Physis.Client.Models.Sponsor.SponsorModel

@{ Layout = "~/Views/ApplicationMaster.cshtml"; }


@section ApplicationTitleBarLinks {
         
    <td id="ApplicationTitleBarThemeSelector">

        <select onchange="UpdateTheme($(this).val());">

            <option value="Blitzer">Blitzer</option>

            <option value="Cupertino">Cupertino</option>

            <option value="Darkness">Darkness</option>

            <option value="Eggplant">Eggplant</option>

            <option value="Humanity">Humanity</option>

            <option value="Lightness">Lightness</option>

            <option value="Overcast">Overcast</option>

            <option value="Redmond">Redmond</option>

            <option value="Smoothness">Smoothness</option>

            <option value="Start">Start</option>

            <option value="Sunny">Sunny</option>

        </select>

    </td>
                           
}


@Html.HiddenFor(model => model.Sponsor.Name)


<div id="SponsorContent" style="margin-left: 4px; margin-right: 6px; margin-top: 4px;">

    <div id="SponsorSummaryContainer" class="ui-widget-content-background ui-widget-content-color TextNormal" style="padding: 0px; margin-bottom: 4px; border: solid 1px; ">

        <div style="padding: 4px;">
            
            <table style="border-collapse:separate; border-spacing: 5px;" > 

                <thead><tr>

                    <th style="width: 40px;"></th>

                    <th></th>
                    
                </tr></thead>

                <tbody>
                    
                    <tr>

                        <td><span id="Sponsor_Name_Label" style="font-weight: bold;">Name:</span></td>

                        <td>

                            @if (Model.Sponsor.Id != 0) { 

                            <div id="Insurer_Name_Read" style="min-height: 24px;">@Model.Sponsor.Name <a href="javascript:void(0);" onclick="$(this).closest ('div').parent().children().toggle();">(edit)</a></div>
                                
                            }

                            <div id="Insurer_Name_Edit" style="min-height: 24px; display: @((Model.Sponsor.Id != 0) ? "none;" : "block;")"> 
                                
                                @Html.TextBoxFor(model => model.Sponsor.Name, new { style="width: 250px;", onchange="Name_OnChange(this);" })

                                @if (Model.Sponsor.Id != 0) { 

                                <a href="#"  >(save)</a>

                                <a href="#" href="javascript:void(0);" onclick="$(this).closest ('div').parent().children().toggle();">(cancel)</a>
                                    
                                }

                            </div>

                        </td>

                    </tr>

                    <tr>

                        <td style="font-weight: bold;">Type:</td>

                        <td>@Model.Sponsor.SponsorTypeName</td>

                    </tr>
              
                </tbody>

            </table>  
        
                <a href="~/Sponsor/SponsorEnroll/@Model.Sponsor.Id" target="_blank">(enroll)</a>

        </div>

        <div id="ExceptionMessageRow" style="display: @((Model.HasException) ? "block" : "none"); margin: 12px; padding: 6px; border: 1px solid black; background-color: #FFDFDF">
        
            <table cellpadding="0" cellspacing="0" width="100%"><tr style="height: 36px;">
                        
                <td style="width: 20px;"><img src="@Url.Content("~/Images/Common16/Stop.png")" style="padding-right: 8px;" alt="Exception Indicator" /></td>
                
                <td style="width: 125px; font-weight: bold; color: #A60000">Exception Occurred:</td>
                
                <td id="ExceptionMessageCell" style="text-align: left;">@Model.ExceptionMessage</td>

            </tr></table>
            
        </div>
           
        <div id="InformationalMessageRow" style="display: @((Model.HasInformationMessage) ? "block" : "none"); margin: 12px; padding: 6px; background-color: #EEFFCC; border: 1px solid black ;">
        
            <table cellpadding="0" cellspacing="0" width="100%"><tr style="height: 36px;">
                        
                <td style="width: 24px;"><img src="@Url.Content("~/Images/Common16/Informational.png")" style="padding-right: 8px;" alt="Informational Indicator" /></td>
                               
                <td id="InformationalMessageCell" class="" style="text-align: left;">@Model.InformationMessage</td>

            </tr></table>
            

        </div>
           
    </div>

    <div id="SponsorTabsContainer" class="ui-widget-content-background ui-widget-content-color TextNormal" style="margin: 0px; padding: 0px; border-bottom: 0px; overflow: visible;">

        <div id="SponsorTabs" style="border: 0px; padding: 0px !important; margin: 0px;">
            
            <ul style="padding-top: 0px; position: relative;">
            
                <li style="height: 25px;"><a href="#TabPlaceholderOverview" class="TextNormal" style="padding-top: 3px; font-weight: normal;">Sponsor</a></li>

                <li style="height: 25px;"><a href="#TabPlaceholderAttributes" class="TextNormal" style="padding-top: 3px; font-weight: normal;">Attributes</a></li>

            </ul>
            
            <div id="TabPlaceholderOverview" style="padding: 0px; margin: 0px;"></div>

            <div id="TabPlaceholderAttributes" style="padding: 0px; margin: 0px;"></div>

        </div>

    </div>
    
    <div id="SponsorDetailContainer" class="ui-widget-content-background ui-widget-content-color TextNormal" style="margin: 0px; padding: 0px; border-top: 0px; overflow: auto;">

        <div>

            <div id="TabOverview" class="TextNormal TabEmployerGroupDetail" style="padding: 8px; border-left: 1px solid; border-right: 1px solid; border-bottom: 1px solid;">
                
                <div class="ui-state-active" style="padding: 4px;">Demographics</div>

                <table id="EntityAddressGrid"></table>

                <table id="EntityContactInformationGrid"></table>

            </div>
        
            <div id="TabAttributes" class="TextNormal TabEmployerGroupDetail" style="padding: 0px; display: none;" requestcontroller="EmployerGroup" requestaction="EmployerGroupAttributes" requestid="@Model.Sponsor.Id">
            
                <img src="@Url.Content("~/Images/AjaxLoading64Red.gif")" alt="Loading" style="display: block; margin: auto; padding: 16px;" />

                <span style="display: block; margin: auto; text-align: center">Loading...</span>

            </div>

        </div>

    </div>

</div>


<script type="text/javascript" src="~/Scripts/Application/Sponsor/Sponsor.js"></script>

<script type="text/javascript">

    Tabs_Initialize("SponsorTabs");


    $("body").addClass("ui-state-default-background");

    $("#ApplicationContent").removeClass("ui-state-default-background ui-state-default-border");


    $("#EntityAddressGrid").jqGrid({});

</script>
